package com.daka.dao;

import com.daka.entity.Organization;
import com.daka.mybatis.SQLMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author beliveli on 2016/3/31 0031.
 */
@Repository(value = "organizationMapper")
@SQLMapper
public interface OrganizationMapper {
    Organization selectById(int orgId);

    List<Organization> selectAllChild(int orgId);

    List<Organization> selectAllChildNoSelf(int orgId);

    List<Organization> selectChild(int orgId);

    int save(Organization organization);

    int updateById(Organization organization);

    int updateStatus(@Param("status") Integer userId, @Param("orgId") Integer orgId);

    List<Organization> selectAllChildByName(@Param("orgId") Integer orgId, @Param("orgName") String orgName, @Param("pageIndex") Integer pageIndex, @Param("pageSize") Integer pageSize);

    int selectCountByName(@Param("orgId") Integer orgId, @Param("orgName") String orgName);

}
